package com.maxd.service.selfWXPay;

import com.maxd.constants.PayScene;
import com.wechat.pay.java.service.payments.jsapi.model.PrepayWithRequestPaymentResponse;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Map;

public interface SelfWXService {


    Map payMargin(Long orderId, Integer type, Long userId) throws Exception;

    /**
     * 微信支付
     * @param type
     * @return
     * @throws Exception
     */
    Map doUnifiedOrder(String payNum, Integer type, Long userId, BigDecimal payMoney,HttpServletRequest request) throws Exception;

    /**
     * 支付回调
     * @param resXml
     * @return
     */
    String payBack(String resXml);
    String payBacks(String resXml);


    //退款
    boolean refund(Long ordersId);

    /**
     * 小程序支付
     * @param payNum
     * @param userId
     * @param payMoney
     * @return
     */
    Map wxPayMp(String payNum, Long userId, BigDecimal payMoney) throws Exception ;

    /**
     * 小程序支付V3版本接口
     * @param paySeq 支付流水号
     * @param payMoney
     * @return
     */
    PrepayWithRequestPaymentResponse wxPayV3(String paySeq, BigDecimal payMoney);

    ResponseEntity notifyMpv3(HttpServletRequest request);

    //小程序支付回调
    String payBackMp(String resXml);

    String notifyMargin(String resXml,Integer type);

    String not(HttpServletRequest request, Integer type);

    void wxPayBack(String out_trade_no, Integer payWay);

}